﻿Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
''' <summary>
''' Hält allgemeine Texturen zur Verfügung
''' </summary>
''' <remarks></remarks>
Public Class TexturenHalter

    Private Shared Balken(1) As Texture
    Private Shared WetterSymbolTexturen(3) As Texture
    Private Shared Wettertexturen(2) As Texture
    Private Shared LaserstrahlTexturen(1) As Texture
    Private Shared SchocklaserStrahlTexturen(1) As Texture
    Private Shared SiegMenüAnzeigen(1) As Texture
    Private Shared BoxHintergründe(1) As Texture
    Private Shared KartenEditorCursorTexturen() As Texture = {}
    Private Shared KartenAuswahlTexturen(4) As Texture
    Private Shared MausFeuerradiusTextur As Texture
    Private Shared DropDownItemTexturen() As Texture = {}
    Private Shared KreuzHaken As Texture
    Private Shared KäseGlocke As Objekt3D = Nothing
    Private Shared RankTexturen(4) As Texture
    Private Shared TaskbarTexturen(2) As Texture

    ''' <summary>
    ''' Lädt unveränderliche Texturen
    ''' </summary>
    ''' <remarks></remarks>
    Public Shared Sub LoadTexturen()
        Balken(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Balkenhinten.png")
        Balken(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Balkenvorne.png")
        WetterSymbolTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Wetter\SymbolSonne.png")
        WetterSymbolTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Wetter\SymbolRegen.png")
        WetterSymbolTexturen(2) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Wetter\SymbolSchnee.png")
        WetterSymbolTexturen(3) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Wetter\SymbolSandsturm.png")
        Wettertexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Wetter\" + ObjektSpielfeld.Wetterarten.Regen.ToString + ".png")
        Wettertexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Wetter\" + ObjektSpielfeld.Wetterarten.Schnee.ToString + ".png")
        Wettertexturen(2) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Wetter\" + ObjektSpielfeld.Wetterarten.Sandsturm.ToString + ".png")
        LaserstrahlTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\LaserMitte.png")
        LaserstrahlTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Laserstrahl.png")
        SchocklaserStrahlTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\SchocklaserStart.png")
        SchocklaserStrahlTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\SchocklaserStrahl.png")
        SiegMenüAnzeigen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\SiegerAnzeige.png")
        SiegMenüAnzeigen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\VerliererAnzeige.png")
        BoxHintergründe(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\BoxHintergrund+0.bmp")
        BoxHintergründe(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\BoxHintergrund+1.bmp")
        'Karteneditor
        KartenEditorCursorTexturen = New Texture() {Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Editor\Cursor+L+O.png"), Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Editor\Cursor+L+U.png"), Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Editor\Cursor+R+O.png"), Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Editor\Cursor+R+U.png")}
        'Kartenauswahl
        KartenAuswahlTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Kartenauswahl\Oben.png")
        KartenAuswahlTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Kartenauswahl\Mitte.png")
        KartenAuswahlTexturen(2) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Kartenauswahl\Unten.png")
        KartenAuswahlTexturen(3) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Kartenauswahl\CursorText.png")
        KartenAuswahlTexturen(4) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Kartenauswahl\KartenauswahlHintergrundTextur.png")
      
        'DropDownItemTexturen
        Array.Resize(DropDownItemTexturen, 3)
        DropDownItemTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\DropDownMenüItem.png")
        DropDownItemTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\DropDownMenüItemSelected.png")
        DropDownItemTexturen(2) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\UpDownRegler.png")
        'Kreuz Haken Texturen laden
        KreuzHaken = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\Haken.png")
        'Rank Texturen
        RankTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Rank Medal\S-Rank.png")
        RankTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Rank Medal\A-Rank.png")
        RankTexturen(2) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Rank Medal\B-Rank.png")
        RankTexturen(3) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Rank Medal\C-Rank.png")
        RankTexturen(4) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Rank Medal\D-Rank.png")
        'taskleisten Texturen
        TaskbarTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\Topleiste.PNG")
        TaskbarTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\TaskleistenTextHintergrund.PNG")
        TaskbarTexturen(2) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Objekte\AuswahlAnzeige.PNG")

    End Sub
    ''' <summary>
    ''' Lädt Texturen, die je nach Design geändert werden müssen
    ''' </summary>
    ''' <remarks></remarks>
    Public Shared Sub LoadModusTexturen()
        'Neutrale Gebäude Texturen
        Dim Ordner As String =ObjektLadeklasse.GetOrdner
        'Maus Texturen
        If Hauptmenü.ZoomedIn Then
            MausFeuerradiusTextur = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Cursor\Zoomed In\Feuerradius.png")
            LaserstrahlTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed In\LaserMitte.png")
            LaserstrahlTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed In\Laserstrahl.png")
            SchocklaserStrahlTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed In\SchocklaserStart.png")
            SchocklaserStrahlTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed In\SchocklaserStrahl.png")

        Else
            MausFeuerradiusTextur = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Cursor\Zoomed Out\Feuerradius.png")
            LaserstrahlTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed Out\LaserMitte.png")
            LaserstrahlTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed Out\Laserstrahl.png")
            SchocklaserStrahlTexturen(0) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed Out\SchocklaserStart.png")
            SchocklaserStrahlTexturen(1) = Grafikengine.LoadTexture(My.Settings.Resourcenpfad + "Animationen\Zoomed Out\SchocklaserStrahl.png")
        End If



    End Sub
    ''' <summary>
    ''' Lädt 3D Sachen
    ''' </summary>
    ''' <remarks></remarks>
    Public Shared Sub Load3D()
        KäseGlocke = New Objekt3D()
        KäseGlocke.MeshBildLaden(My.Settings.Resourcenpfad + "Objekte\Glocke.x")
    End Sub
    Public Shared Function GetBalken(ByVal Vorne As Boolean) As Texture
        If Vorne Then
            Return Balken(1)
        Else
            Return Balken(0)
        End If
    End Function
    Public Shared Function GetWetterSymbol(ByVal Wetter As ObjektSpielfeld.Wetterarten) As Texture
        Return WetterSymbolTexturen(Wetter)
    End Function
    Public Shared Function GetWetterSymbol() As Texture
        Return WetterSymbolTexturen(Objektverwalter.Spielfeld.Regeln.Wetter)
    End Function
    Public Shared Function GetWetter(ByVal Wetter As ObjektSpielfeld.Wetterarten) As Texture
        If Wetter = ObjektSpielfeld.Wetterarten.Sonne Then Return Nothing
        Return Wettertexturen(Wetter - 1)
    End Function
    Public Shared Function GetLaserMitte() As Texture
        Return LaserstrahlTexturen(0)
    End Function
    Public Shared Function GetLaserStrahl() As Texture
        Return LaserstrahlTexturen(1)
    End Function
    Public Shared Function GetSchocklaserStart() As Texture
        Return SchocklaserStrahlTexturen(0)
    End Function
    Public Shared Function GetSchocklaserStrahl() As Texture
        Return SchocklaserStrahlTexturen(1)
    End Function
    Public Shared Function GetSiegMenüSiegerTextur() As Texture
        Return SiegMenüAnzeigen(0)
    End Function
    Public Shared Function GetSiegMenüVerliererTextur() As Texture
        Return SiegMenüAnzeigen(1)
    End Function
    Public Shared Function GetBoxHintergrund(ByVal ID As Integer) As Texture
        Return BoxHintergründe(ID)
    End Function
    Public Shared Function GetKartenEditorCursor(ByVal I As Integer) As Texture
        If I < KartenEditorCursorTexturen.Length Then
            Return KartenEditorCursorTexturen(I)
        Else
            Return KartenEditorCursorTexturen(0)
        End If
    End Function
    Public Shared Function GetKartenAuswahlTexturen(ByVal I As Integer) As Texture
        If I < KartenAuswahlTexturen.Length Then
            Return KartenAuswahlTexturen(I)
        Else
            Return KartenAuswahlTexturen(0)
        End If
    End Function
    Public Shared Function GetMausFeuerradiusTextur() As Texture
        Return MausFeuerradiusTextur
    End Function
    Public Shared Function GetDropDownItemTexturen(ByVal I As Integer) As Texture
        Return DropDownItemTexturen(I)
    End Function
    Public Shared Function GetKreuzHakenTextur() As Texture
        Return KreuzHaken
    End Function
    Public Shared Function GetKäseGlocke() As Objekt3D
        Return KäseGlocke
    End Function
    Public Shared Function GetRankTextur(ByVal Rank As ObjektAufzeichnungen.Rang) As Texture
        Return RankTexturen(Rank)
    End Function
    Public Shared Function GetTaskbarTexturen(ByVal ID As Integer) As Texture
        Return TaskbarTexturen(ID)
    End Function
End Class
